// pages/baseInfo/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    infoList: {
      'shopName': {
        title: '商户联系人',
        value: '望天',
        isArrow: false,
      },
      'shopIphone': {
        title: '电话',
        value: '13589877890',
        isArrow: true,
      },
      'email': {
        title: '联系人邮箱',
        value: '8484545@qq.com',
        isArrow: true,
      },
      'customerIphone': {
        title: '客服电话',
        value: '15845545545',
        isArrow: false,
      },
      'shopAddress': {
        title: '商户地址',
        value: '湖北省',
        isArrow: true,
      },
      'industryType': {
        title: '行业类别',
        value: '书籍/印象/文具',
        isArrow: false,
      }
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  toOtherPage(e) {
    if (e.currentTarget.dataset.page === '电话') {
      wx.navigateTo({
        url: '/pages/baseInfoModify/index',
        success: function (res) {
          res.eventChannel.emit('acceptDataFromOpenerPage', {
            type: 'iphone'
          })
        }
      })
    } else if (e.currentTarget.dataset.page === '联系人邮箱') {
      wx.navigateTo({
        url: '/pages/baseInfoModify/index',
        success: function (res) {
          res.eventChannel.emit('acceptDataFromOpenerPage', {
            type: 'email'
          })
        }
      })
    }

  },
  onLoad: function (options) {
    const eventChannel = this.getOpenerEventChannel()
    eventChannel.on('acceptDataFromOpenerPage', function (data) {
      console.log(data);
    })
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})